home *** CD-ROM | disk | FTP | other *** search
- unit DockEgU;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, ExtCtrls;
-
- type
- TForm1 = class(TForm)
- Panel1: TPanel;
- Button1: TButton;
- Label1: TLabel;
- procedure Button1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- uses DockEgU2;
-
- {$R *.DFM}
-
- type
- TMyDockTree = class(TDockTree)
- protected
- procedure AdjustDockRect(Control: TControl; var ARect: TRect); override;
- procedure PaintDockFrame(Canvas: TCanvas; Control: TControl;
- const ARect: TRect); override;
- end;
-
- { TMyDockTree }
-
- procedure TMyDockTree.AdjustDockRect(Control: TControl; var ARect: TRect);
- begin
- //Do nothing to change the control's boundaries as
- //there will be no dock grabber lines or close button
- end;
-
- procedure TMyDockTree.PaintDockFrame(Canvas: TCanvas; Control: TControl;
- const ARect: TRect);
- begin
- //Do nothing as we do not want dock grabber lines or close button
- end;
-
- { TForm1 }
-
- procedure TForm1.FormCreate(Sender: TObject);
- begin
- {$ifndef CompletelyReplaceDefaultDockManager}
- //Use this code to change just the panel's dock manager
- //Note that we do not need to free this object since the property
- //is actually an interface reference, and will auto-free
- Panel1.DockManager := TMyDockTree.Create(Panel1)
- {$endif}
- end;
-
- procedure TForm1.Button1Click(Sender: TObject);
- begin
- if Form2.Floating then
- Form2.ManualDock(Panel1)
- else
- Form2.ManualDock(nil)
- end;
-
- initialization
- {$ifdef CompletelyReplaceDefaultDockManager}
- //Only use this code to change all docking to draw no adornments
- DefaultDockTreeClass := TMyDockTree
- {$endif}
- end.
-